﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="LabelingResult.aspx.cs" Inherits="QuerySelectionLabelingTool.LabelingResult" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSourceLabelingUser" PageSize="30" Width="928px" 
        ondatabound="GridView1_DataBound" style="margin-right: 9px">
        <Columns>
            <asp:BoundField DataField="newsID" HeaderText="News ID" 
                SortExpression="newsID" >
            <ItemStyle Width="80px" HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="newsTitle" HeaderText="News Title" 
                SortExpression="newsTitle" ReadOnly="True" >
            <ItemStyle Width="80px" HorizontalAlign="Left" />
            </asp:BoundField>
            <asp:BoundField DataField="newsContent" HeaderText="News Content" ReadOnly="True" 
                SortExpression="newsContent" >
            <ItemStyle HorizontalAlign="Left" />
            </asp:BoundField>
            <asp:BoundField DataField="expID" HeaderText="Experiment ID" 
                SortExpression="expID">
            <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="ExperimentName" HeaderText="Experiment Name" 
                SortExpression="ExperimentName">
            <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="query" HeaderText="Query" 
                SortExpression="query" >
            <ItemStyle HorizontalAlign="Center" Width="180px" />
            </asp:BoundField>
            <asp:BoundField DataField="Rank" HeaderText="Judgement" ReadOnly="True" 
                SortExpression="Rank" >
            <ItemStyle HorizontalAlign="Center" Width="50px" />
            </asp:BoundField>
            <asp:BoundField DataField="username" HeaderText="Judger" ReadOnly="True" 
                SortExpression="username" >
            <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSourceLabelingUser" runat="server" 
        ConnectionString="<%$ ConnectionStrings:QuerySelectionLabelingToolConnectionString %>" 
        
        
        
        SelectCommand="SELECT tb_e.newsID, (SELECT title FROM tb_news WHERE (ID = tb_e.newsID)) AS newsTitle, (SELECT newsContent FROM tb_news AS tb_news_1 WHERE (ID = tb_e.newsID)) AS newsContent, tb_e.expID, (SELECT name FROM tb_exp WHERE (ID = tb_e.expID)) AS ExperimentName, tb_q.query, tb_q.position, CASE tb_q.[rank] WHEN 0 THEN 'Good' WHEN 1 THEN 'Fair' WHEN 2 THEN 'Bad' END AS Rank, (SELECT name FROM tb_user WHERE (ID = tb_e.userID)) AS username FROM tb_experiments AS tb_e INNER JOIN tb_experimentsQuery AS tb_q ON tb_e.ID = tb_q.experimentsID WHERE (tb_q.rank &lt;&gt; - 1) AND (tb_e.taskID = @taskID) GROUP BY tb_e.userID, tb_e.newsID, tb_e.expID, tb_q.query, tb_q.position, tb_q.rank">
        <SelectParameters>
            <asp:QueryStringParameter Name="taskID" QueryStringField="taskID" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>
